package app.caretrack.model;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

@Entity
@Table(name = "ServicePackages")
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class ServicePackage extends NamedBaseModel {

    private List<ServicePackageOption> servicePackageOptionList;

    @ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
    @JoinTable(name = "Valid_ServicePackage_Option", inverseJoinColumns = @JoinColumn(name = "ServicePackage_Options_Id"), joinColumns = @JoinColumn(name = "ServicePackage_Id"))
    public List<ServicePackageOption> getServicePackageOptionList() {
        return this.servicePackageOptionList;
    }

    public void setServicePackageOptionList(
            List<ServicePackageOption> servicePackageOptionList) {
        this.servicePackageOptionList = servicePackageOptionList;
    }

}
